package com.digitalchina.lxnsy.activity.farmTrain;

import android.webkit.JavascriptInterface;

import com.digitalchina.lxnsy.base.BaseHtmlActivity;
import com.digitalchina.lxnsy.toolkit.StringUtil;
import com.digitalchina.lxnsy.toolkit.Utils;

/**
 * ================================================
 * 项目名称：android
 * 类描述：已选中的机构
 * 创建人：rxx
 * 创建时间：2020/1/15 17:26
 * 修改备注：
 * ================================================
 */
public class TrainSelectFinshActivity extends BaseHtmlActivity {

    @Override
    protected void loadHtml() {
        webView.addJavascriptObject(new JsApi(), null);
        loadUrl("train-selected-finsh");
        setTitle("已选中的机构");
    }

    @Override
    public void rightOnClick() {

    }

    public class JsApi {
        //去详情
        @JavascriptInterface
        public void goDetails(Object msg) {
            go(TrainQuoteDetailsActivity.class);
        }

        //看报价
        @JavascriptInterface
        public void goViewQuote(Object msg) {
            go(TrainQuoteDetailsActivity.class);
        }

        //机构主页
        @JavascriptInterface
        public void goJiGou(Object msg) {
            go(TrainAgencyDetailActivity.class);
        }

        //联系需求方
        @JavascriptInterface
        public void callPhone(Object msg) {
            if (msg != null) {
                String tel = msg.toString();
                if (!StringUtil.isStrEmpty(msg.toString())) {
                    Utils.callPhone(activity, tel);
                }
            }
        }

    }
}
